'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.bulkInsert('Rights', [
      {
        key: "/home",
        title: "首页",
        pagePermission: 1,
        grade: 1,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/user-manage",
        title: "用户管理",
        pagePermission: 1,
        grade: 1,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/user-manage/add",
        title: "添加用户",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/user-manage/update",
        title: "修改用户",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/user-manage/delete",
        title: "删除用户",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/user-manage/list",
        title: "用户列表",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/right-manage",
        title: "权限管理",
        pagePermission: 1,
        grade: 1,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/right-manage/add",
        title: "新增权限",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/right-manage/update",
        title: "修改权限",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/right-manage/delete",
        title: "删除权限",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/right-manage/list",
        title: "权限列表",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/role-manage/add",
        title: "新增角色",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/role-manage/update",
        title: "修改角色",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/role-manage/delete",
        title: "删除角色",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/role-manage/list",
        title: "角色列表",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/audit-manage",
        title: "审核管理",
        pagePermission: 1,
        grade: 1,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/audit-manage/verify",
        title: "业务审核",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/audit-manage/list",
        title: "审核列表",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/service-manage",
        title: "业务管理",
        pagePermission: 1,
        grade: 1,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/service-manage/add",
        title: "新办业务",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/service-manage/update",
        title: "修改业务",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/service-manage/delete",
        title: "删除业务",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/service-manage/list",
        title: "业务列表",
        pagePermission: 1,
        grade: 1,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/department-manage",
        title: "部门管理",
        pagePermission: 1,
        grade: 1,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/department-manage/add",
        title: "新建部门",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/department-manage/update",
        title: "修改部门",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/department-manage/delete",
        title: "删除部门",
        pagePermission: 0,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/department-manage/list",
        title: "部门列表",
        pagePermission: 1,
        grade: 1,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/service-manage/category",
        title: "主项管理",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/service-manage/service",
        title: "办理项管理",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/service-manage/category_services",
        title: "事项管理",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/system-manage",
        title: "其他",
        pagePermission: 1,
        grade: 1,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/system-manage/audit-list",
        title: "审核状态管理",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/system-manage/channel-list",
        title: "渠道管理",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/system-manage/circulation-list",
        title: "办结管理",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/system-manage/location-list",
        title: "位置管理",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/system-manage/risk-list",
        title: "风险管理",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      },
      {
        key: "/system-manage/type-list",
        title: "类别管理",
        pagePermission: 1,
        grade: 2,
        createdAt: new Date(),
        updatedAt: new Date()
      }
    ], {});
  },

  async down(queryInterface, Sequelize) {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    await queryInterface.bulkDelete('Rights', null, {});
  }
};
